package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		//SpringApplication.run(DemoApplication.class, args);

		SpringApplication springApplication = new SpringApplication(DemoApplication.class);
		
		//添加启动监听事件
		springApplication.addListeners(new ApplicationStartedEventListener());
		
		//添加启动完成监听事件
		springApplication.addListeners(new ApplicationReadyEventListener());

		springApplication.run(args);

	}

}
